<?php
$config = require dirname(__DIR__) . '/config/config.php';
date_default_timezone_set('PRC');
$redisConf = $config->get('redisBackend', '127.0.0.1:6379');
ImWorker\ImEqueue::setBackend($redisConf);

/**
 *  兼容操作
 */
class ImEqueue
{
    private static $queueMaps = [
        'default' => '\Jobs\BadJob',
    ];

    public static function enqueue($queue, $data)
    {
        return ImWorker\ImEqueue::enqueue($queue, self::$queueMaps[$queue], $data, true);
    }

    public static function dequeue($queue)
    {
        return ImWorker\ImEqueue::reserve($queue);
    }
}
